package br.com.threads;


class YH implements Runnable{
	public void run(){
		for(int i = 1; i <= 5; i++){
			System.out.println("Valor de i: " + i + " " +
					Thread.currentThread().getName());
			try{
				Thread.sleep(3000);
			}catch(InterruptedException e){
				e.printStackTrace();
			}
		}
	}
}
public class Programa38 {
	public static void main(String[] args) {
		YH y = new YH();
		Thread t1 = new Thread(y);
		Thread t2 = new Thread(y);
		Thread t3 = new Thread(y);
		t1.setPriority(3);
		t2.setPriority(10);
		t3.setPriority(7);
		t1.setName("Thread 1");
		t2.setName("Thread 2");
		t3.setName("Thread 3");
		t1.start();t2.start();t3.start();			
	}
}
